import request from '@/utils/request'

export function clueList(data) {
  return request({
    url: '/tienchin/clue/list',
    method: 'get',
    params: data
  })
}

//渠道来源
export function channels() {
  return request({
    url: '/tienchin/clue/channels',
    method: 'get',
  })
}

//线索状态
export function clueStatus() {
  return request({
    url: '/system/dict/data/type/clue_status',
    method: 'get',
  })
}

export function activity(id) {
  return request({
    url: '/tienchin/clue/activity/' + id,
    method: 'get',
  })
}
// 添加
export function clueAdd(datas) {
  return request({
    url: '/tienchin/clue',
    method: 'post',
    data:datas
  })
}
//删除
export function clueDel(id) {
  return request({
    url: '/tienchin/clue/'+id,
    method: 'delete',
  })
} 

//根据id查询数据

export function summary(id) {
  return request({
    url: '/tienchin/clue/summary/'+id,
    method: 'get',
  })
} 

//修改
export function clueEidtor (datas) {
  return request({
    url: '/tienchin/clue',
    method: 'put',
    data:datas
  })
}
//导出
export function exportClue(data){
  return request({
    method:'post',
    url:"/tienchin/activity/export",
    data,
    //设置服务器返回的数据类型是个二进制文件对象 blob
    responseType:'blob'
  })
}